<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ include file="/share/_meta.jsp" %>
<%@ include file="/share/_footer.jsp" %>
<div class="page-container">
    <form class="form form-horizontal" id="myform">
        <input type="hidden" value="${id }" name="id" id="id">      
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red"></span>购方税号：</label>
            <div class="formControls col-xs-8 col-sm-9">
             <input type="text" class="layui-input input-text radius size-L" placeholder="企业要填，个人可为空" value="" name="buyerTaxNum" id="buyerTaxNum">
            </div>
        </div>
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>冲红备注：</label>
            <div class="formControls col-xs-8 col-sm-9">
                 <textarea class="layui-input input-text radius size-L" placeholder="请填写冲红备注" style="height: 250px;" name="remark" id="remark" rows="" cols=""></textarea>
            </div>
        </div>      
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <button type="button" class="btn btn-secondary radius size-L" id="save">保&nbsp;存</button>
                <button type="button" class="btn btn-secondary radius size-L" onclick="layer_close();">取&nbsp;消</button>
            </div>
        </div>
    </form>
</div>
<script type="text/javascript">
$('#save').click(function(){
	var remark = $("#remark").val();
    if (remark == "") {
        layer.alert("请填写冲红备注");
        return false;
    }
	$('#myform').ajaxSubmit({
        type: 'post',
        url: "${pageContext.request.contextPath }/rest/rejectNuoNuoInvoiceByDirectfee",
        dataType: 'json',
        beforeSubmit: function () {
            layer.load();
        },
        success: function(data){
            layer.closeAll('loading');
            if (data.success) {
            	window.parent.location.reload();
            }else {
                layer.alert(data.message);
            }
        },
        error: function(XmlHttpRequest, textStatus, errorThrown){
        	layer.closeAll('loading');
            layer.alert('error!',{icon:1,time:1000});
        }
    });
});
</script>